home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
HeapScheduler.cc,v
< prev
next >
Wrap
Text File
|
1988-12-20
|
2KB
|
116 lines
head 3.1;
branch ;
access ;
symbols ;
locks ; strict;
comment @@;
3.1
date 88.12.20.13.48.51; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.10.30.13.03.09; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.18.16.42.24; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.1
log
@Steay version
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#include "Thread.h"
#include "HeapScheduler.h"
#include "stream.h"
#include "assert.h"
void
HeapScheduler::add(Thread *t)
{
heap.add( ThreadHeapItem(t) );
}
void
HeapScheduler::add(double xkey, Thread *t)
{
t -> priority(ThreadPriority(xkey));
heap.add( ThreadHeapItem(t) );
}
void
HeapScheduler::add(int xkey, Thread *t)
{
t -> priority(ThreadPriority(xkey));
heap.add( ThreadHeapItem(t) );
}
Thread *
HeapScheduler::remove()
{
ThreadHeapItem item;
int removed = heap.remove(item);
assert(removed);
return(item.thread());
}
Thread *
HeapScheduler::remove(Thread *)
{
assert2(FALSE, "[HeapScheduler]: remove of specific item not implemented");
return(0);
}
bool HeapScheduler::isEmpty()
{
return(heap.isEmpty());
}
unsigned int HeapScheduler::size()
{
return(heap.size());
}
void HeapScheduler::classPrintOn(ostream& s)
{
s << "[HeapScheduler] " << heap;
}
@
1.2
log
@*** empty log message ***
@
text
@@
1.1
log
@Initial revision
@
text
@d1 6
d35 2
a36 1
heap.remove(item);
@